home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
B-Book Series
/
(k)b2.d64
/
exe131
< prev
next >
Wrap
Text File
|
2007-02-28
|
2KB
|
69 lines
0010 DIM FRUIT$(6) OF 10, TOKEN$ OF 1
0020 DIM F1$ OF 10, F2$ OF 10, F3$ OF 10
0030 WINNINGS:=0; STAKED:=0
0040 //
0050 FRUIT$(1):="APPLE"
0060 FRUIT$(2):="PEAR"
0070 FRUIT$(3):="PLUM"
0080 FRUIT$(4):="BANANA"
0090 FRUIT$(5):="LEMON"
0100 FRUIT$(6):="GRAPE"
0110 //
0120 CLEAR'TO(4)
0130 PRINT "HERE WE GO! TO INSERT A COIN"
0140 PRINT "IN THE SLOT, PRESS 'RETURN'."
0150 PRINT "TO STOP, PRESS 'N' AND 'RETURN'."
0160 REPEAT
0170 PRINT
0180 PRINT "INSERT A COIN",
0190 INPUT TOKEN$
0200 IF TOKEN$="N" THEN ADIEU
0210 THE'GAME
0220 UNTIL FALSE //FOREVER//
0230 //
0240 PROC THE'GAME
0250 STAKED:=STAKED+1
0260 F1$:=FRUIT$(RND(1,6))
0270 F2$:=FRUIT$(RND(1,6))
0280 F3$:=FRUIT$(RND(1,6))
0290 CLEAR'TO(5)
0300 PRINT F1$,TAB(15),F2$,TAB(30),F3$
0310 RESULT
0320 ENDPROC THE'GAME
0330 //
0340 PROC RESULT
0350 FOR I:=1 TO 3 DO PRINT //3 DOWN
0360 IF F1$=F2$ AND F2$=F3$ THEN
0370 BELL(7)
0380 PRINT "HURRAH! H U R R A H! H U R R A H!!"
0390 PRINT "YOU HAVE WON 20 COINS!!!"
0400 WINNINGS:=WINNINGS+20
0410 ELSE
0420 IF F1$=F2$ OR F2$=F3$ THEN
0430 BELL(2)
0440 PRINT "FINE!"
0450 PRINT "YOU HAVE WON 2 COINS!"
0460 WINNINGS:=WINNINGS+2
0470 ENDIF
0480 ENDIF
0490 ENDPROC RESULT
0500 //
0510 PROC ADIEU
0520 CLEAR'TO(5)
0530 PRINT "IT WAS NICE TO PLAY WITH YOU."
0540 PRINT "ASK OUR CASHIER TO EXCHANGE"
0550 PRINT "YOUR WINNINGS INTO REAL MONEY"
0560 PRINT "- IF HE HAS ANY - AS A RULE HE HASN'T,"
0570 PRINT "BUT WE HOPE YOU HAD SOME FUN."
0580 STOP //STOP THE PROGRAM
0590 ENDPROC ADIEU
0600 //
0610 PROC CLEAR'TO(X)
0620 PRINT CHR$(147), //CLEAR
0630 FOR I:=1 TO X DO PRINT //X DOWN
0640 ENDPROC CLEAR'TO
0650 //
0660 PROC BELL(X)
0670 FOR I:=1 TO X DO PRINT CHR$(7),
0680 ENDPROC BELL